<!--第二步骤  个人资料模块scroll-to-error-->
<template>
  <div class="container">
    <van-form @submit="onSubmit">
      <!--      姓名|性别|出生年月-->
      <username-sex></username-sex>
      <!--      政治面貌|文化程度|身高-->
      <content2></content2>
      <!--      户籍性质|婚姻状况|户籍所在地-->
      <content3></content3>
      <!--      户籍所在地详细地址|家庭居住地|家庭居住地详细地址-->
      <content4></content4>
      <!--      固定电话|工作单位|左眼视力|右眼视力|自我评价-->
      <content5></content5>
      <div style="margin: 16px;">
        <van-button round block type="info" native-type="submit">
          下一步
        </van-button>
      </div>
    </van-form>
  </div>
</template>

<script>
import UsernameSex from './component/username-sex'
import Content2 from './component/content2'
import Content3 from './component/content3'
import Content4 from './component/content4'
import Content5 from './component/content5'

export default {
  name: 'personal',
  components: {
    Content5,
    Content4,
    Content3,
    Content2,
    UsernameSex
  },
  data () {
    return {
      a: false
    }
  },
  methods: {
    onSubmit (e) {
      this.$store.dispatch('addUsername', {
        type: 'addUsername',
        name: e.name,
        sex: e.sex,
        birthday: e.birthday,
        politics: e.politics,
        education: e.education,
        height: e.height,
        native_type: e.native_type,
        is_marry: e.is_marry,
        native_addr: e.native_addr,
        native_addr_desc: e.native_addr_desc,
        home_addr: e.home_addr,
        home_addr_desc: e.home_addr_desc,
        tel: e.tel,
        work_place: e.work_place,
        eye_left: e.eye_left,
        eye_right: e.eye_right,
        summary: e.summary
      })
      this.$emit('part2', false)
    }
  }
}
</script>

<style lang="scss" scoped>
.container {
  width: 100%;
  overflow: auto;
}
</style>
